package com.wkbb.basic.thread;

import com.wkbb.basic.service.UserFacePersonConfigService;
import com.wkbb.common.dto.basic.UserDto;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author dengjingyuan
 * @date 2019-09-12 15:29
 */
@Slf4j
public class BasicTask implements Runnable {

    private UserFacePersonConfigService userFacePersonConfigService;

    private UserDto userDto;

    private List<Object[]> data;

    public BasicTask(UserFacePersonConfigService userFacePersonConfigService, UserDto userDto, List<Object[]> data) {
        this.userFacePersonConfigService = userFacePersonConfigService;
        this.userDto = userDto;
        this.data = data;
    }

    public BasicTask() {

    }

    @Override
    public void run() {
        log.info("*******BasicTask**********apiVersion:{},userFacePersonConfigService:{}", userFacePersonConfigService, userDto, data);
        try {
            userFacePersonConfigService.saveImportData(userDto, data);
        } catch (Exception e) {
            log.error("*******BasicTask**********apiVersion:{},userFacePersonConfigService:{}", userFacePersonConfigService, userDto, data);
        }
    }
}
